package org.lc.service.system.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.lc.platform.mybatis.entity.BaseEntity;
import org.lc.platform.mybatis.manager.annotation.OneToMany;
import org.lc.platform.mybatis.manager.annotation.OrderBy;
import org.lc.platform.mybatis.manager.annotation.Params;

import java.io.Serial;
import java.io.Serializable;
import java.util.List;

/**
 * sys_menu
 */
@EqualsAndHashCode(callSuper = true)
@Data
@TableName(autoResultMap = true)
@ToString(callSuper = true)
@OrderBy(params = {
        @Params(field = "createTime", isAsc = true)
})
public class SysPermission extends BaseEntity implements Serializable {


    public SysPermission() {
    }

    public SysPermission(String menuId, String name, String code) {
        this.name = name;
        this.code = code;
        this.menuId = menuId;
    }

    /**
     * 备注
     */
    private String remark;

    /**
     * 权限点名称
     */
    private String name;

    /**
     * 权限点代码
     */
    private String code;
    /**
     * 是否禁用该权限点
     */
    private Boolean forbidden;
    /**
     * 对应菜单ID
     */
    private String menuId;

    @OneToMany(targetField = "SysPermissionId")
    @TableField(exist = false)
    private List<SysRolePermission> rolePermission;

    @Serial
    private static final long serialVersionUID = 1L;
}